package com.nbsaas.sample.topic.rest.convert;

import com.nbsaas.sample.entity.topic.Topic;
import com.nbsaas.sample.topic.api.domain.request.TopicDataRequest;

import org.springframework.beans.BeanUtils;
import com.nbsaas.boot.rest.api.Converter;
import com.nbsaas.boot.utils.BeanDataUtils;

/**
* 请求对象转换成实体对象
*/

public class TopicEntityConvert  implements Converter<Topic, TopicDataRequest> {
@Override
public Topic convert(TopicDataRequest source) {
Topic result = new Topic();
BeanDataUtils.copyProperties(source, result);
return result;
}
}

